/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package escr.persistencia;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Aditardo
 */
@Entity
@Table(name = "diagnostico")
@NamedQueries({@NamedQuery(name = "Diagnostico.findByDgnCod", query = "SELECT d FROM Diagnostico d WHERE d.dgnCod = :dgnCod"), @NamedQuery(name = "Diagnostico.findByDgnEnfermedad", query = "SELECT d FROM Diagnostico d WHERE d.dgnEnfermedad = :dgnEnfermedad"), @NamedQuery(name = "Diagnostico.findByDgnMedicina", query = "SELECT d FROM Diagnostico d WHERE d.dgnMedicina = :dgnMedicina"), @NamedQuery(name = "Diagnostico.findByDgnProblema", query = "SELECT d FROM Diagnostico d WHERE d.dgnProblema = :dgnProblema"), @NamedQuery(name = "Diagnostico.findByDgnObservacion", query = "SELECT d FROM Diagnostico d WHERE d.dgnObservacion = :dgnObservacion"), @NamedQuery(name = "Diagnostico.findByDgnFecha", query = "SELECT d FROM Diagnostico d WHERE d.dgnFecha = :dgnFecha"), @NamedQuery(name = "Diagnostico.findByDgnHora", query = "SELECT d FROM Diagnostico d WHERE d.dgnHora = :dgnHora")})
public class Diagnostico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "DGN_COD", nullable = false)
    private Integer dgnCod;
    @Column(name = "DGN_ENFERMEDAD")
    private String dgnEnfermedad;
    @Column(name = "DGN_MEDICINA")
    private String dgnMedicina;
    @Column(name = "DGN_PROBLEMA")
    private String dgnProblema;
    @Column(name = "DGN_OBSERVACION")
    private String dgnObservacion;
    @Column(name = "DGN_FECHA")
    @Temporal(TemporalType.DATE)
    private Date dgnFecha;
    @Column(name = "DGN_HORA")
    @Temporal(TemporalType.TIME)
    private Date dgnHora;
    @JoinColumn(name = "TUR_CODIGO", referencedColumnName = "TUR_CODIGO")
    @ManyToOne
    private Turno turCodigo;

    public Diagnostico() {
    }

    public Diagnostico(Integer dgnCod) {
        this.dgnCod = dgnCod;
    }

    public Integer getDgnCod() {
        return dgnCod;
    }

    public void setDgnCod(Integer dgnCod) {
        this.dgnCod = dgnCod;
    }

    public String getDgnEnfermedad() {
        return dgnEnfermedad;
    }

    public void setDgnEnfermedad(String dgnEnfermedad) {
        this.dgnEnfermedad = dgnEnfermedad;
    }

    public String getDgnMedicina() {
        return dgnMedicina;
    }

    public void setDgnMedicina(String dgnMedicina) {
        this.dgnMedicina = dgnMedicina;
    }

    public String getDgnProblema() {
        return dgnProblema;
    }

    public void setDgnProblema(String dgnProblema) {
        this.dgnProblema = dgnProblema;
    }

    public String getDgnObservacion() {
        return dgnObservacion;
    }

    public void setDgnObservacion(String dgnObservacion) {
        this.dgnObservacion = dgnObservacion;
    }

    public Date getDgnFecha() {
        return dgnFecha;
    }

    public void setDgnFecha(Date dgnFecha) {
        this.dgnFecha = dgnFecha;
    }

    public Date getDgnHora() {
        return dgnHora;
    }

    public void setDgnHora(Date dgnHora) {
        this.dgnHora = dgnHora;
    }

    public Turno getTurCodigo() {
        return turCodigo;
    }

    public void setTurCodigo(Turno turCodigo) {
        this.turCodigo = turCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dgnCod != null ? dgnCod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Diagnostico)) {
            return false;
        }
        Diagnostico other = (Diagnostico) object;
        if ((this.dgnCod == null && other.dgnCod != null) || (this.dgnCod != null && !this.dgnCod.equals(other.dgnCod))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "escr.persistencia.Diagnostico[dgnCod=" + dgnCod + "]";
    }

}
